<%--
  Created by IntelliJ IDEA.
  User: 如烟
  Date: 2020/9/25
  Time: 9:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>订单</title>
    <!-- Meta tags -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Online Auto Booking Form Responsive Widget,Login form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat Drop downs,Registration Forms,News letter Forms,Elements"/>
    <script type="application/x-javascript">
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);
        function hideURLbar() {
            window.scrollTo(0, 1);
        }
    </script>
    <!-- //Meta tags -->
    <!-- Stylesheet -->
    <link href="${pageContext.request.contextPath}/static/css/userCSS/wickedpicker.css" rel="stylesheet" type='text/css' media="all" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/userCSS/jquery-ui2.css" />
    <link href="${pageContext.request.contextPath}/static/css/userCSS/style4.css" rel='stylesheet' type='text/css' />
    <!-- //Stylesheet -->
    <!--fonts-->
    <link href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">
    <link href="//fonts.googleapis.com/css?family=Montserrat+Alternates:200,400,500,600,700" rel="stylesheet">
    <!--//fonts-->


</head>

<body>
<div class="adcenter"><script src="http://www.cssmoban.com/include/new/ggad2_728x90.js"></script></div>
<!--background-->
<h1> <span>M</span>我 <span>A</span>的 <span>Y</span>订 <span>D</span>单 </h1>
<div class="bg-agile">
    <div class="left-agileits-w3layouts-img">
        <h3>温馨提示</h3>
        <ul>
            <li><span>.</span>24小时专车接送</li>
            <li><span>.</span>24小时随时在线预订</li>
            <li><span>.</span>24小时监控为您的安全保驾护航</li>
            <li><span>.</span>室外超大泳池</li>
        </ul>
        <p>- 顾客是上帝.</p>
    </div>
    <div class="book-appointment">
        <div style="float: right; color: white"><a href="${pageContext.request.contextPath}/user/roomShow">x</a></div>
        <h2>我的订单</h2>
        <input type="hidden" name="userId" id="userId" value="${user.userId}">
        <div class="book-agileinfo-form">
            <table border="1" cellspacing="0" cellpadding="0" style="font-style: oblique;color: white;border-color: rgb(236,183,49)" >
                <tr>
                    <th>入住登记人</th>
                    <th>入住时间</th>
                    <th>房型</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${pageInfo.list}" var="order">
                <tr>
                    <td style="text-align: center">${order.loginName}</td>
                    <td><fmt:formatDate value="${order.starttime}" pattern="yyyy-MM-dd"/></td>
                    <td>${order.hotelType}</td>
                    <td>
                        <input type="button" value="删除" onclick="delOrder('${order.checkId}')">
                        <input type="button" value="修改" onclick="updateOrder('${order.checkId}')">
                    </td>
                </tr>
                </c:forEach>
            </table>
            <span style="color: #fd7e14">${msg}</span>
            <%--        分页--%>
            <div class="col-md-6 offset-md-4" style="text-align: center;width: 580px">
                <nav aria-label="Page navigation example">
                    <ul class="pagination pagination-sm">
                        <li class="page-item"><a class="page-link" href="${pageContext.request.contextPath}/user/orderShow?page=${pageInfo.pages}" style="float: right">末页</a></li>
                        <c:if test="${pageInfo.hasNextPage}">
                            <li class="page-item"><a class="page-link" href="${pageContext.request.contextPath}/user/orderShow?page=${pageInfo.pageNum+1}" style="float: right">下一页</a></li>
                        </c:if>
                        <c:if test="${pageInfo.hasPreviousPage}">
                            <li class="page-item"><a class="page-link" href="${pageContext.request.contextPath}/user/orderShow?page=${pageInfo.pageNum-1}" style="float: right">上一页</a></li>
                        </c:if>
                        <li class="page-item"><a class="page-link" href="${pageContext.request.contextPath}/user/orderShow?page=1" style="float: right">首页</a></li>
                    </ul>
                </nav>
            </div>
            <%--        分页--%>
        </div>

    </div>
</div>
<!--copyright-->
<div class="copy-w3layouts">
    <p>&copy; 2020. 假日酒店 | Design by  |  yyl & hql
    </p>
</div>
<!--//copyright-->
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/userJS/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/userJS/jquery-2.2.3.min.js"></script>
<!-- Time -->
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/userJS/wickedpicker.js"></script>

<script>
    function delOrder(checkId) {
        var i = confirm("确定删除该订单吗?")
        if (i){
            $.post("${pageContext.request.contextPath}/user/delOrder",{"checkId":checkId},function () {
                alert("删除成功")
                window.location.reload;
            })
        }else {
            alert("删除失败")
            return false;
        }
    }
    function updateOrder(checkId) {
        location.href = "${pageContext.request.contextPath}/user/orderUpdateInit?checkId="+checkId
    }

</script>

<script type="text/javascript">
    $('.timepicker').wickedpicker({
        twentyFour: false
    });
</script>
<!--// Time -->
<!-- Calendar -->
<script src="${pageContext.request.contextPath}/static/js/userJS/jquery-ui2.js"></script>
<script>
    $(function () {
        $("#datepicker,#datepicker1,#datepicker2,#datepicker3").datepicker();
    });
</script>
<!-- //Calendar -->

</body>
</html>
